{extend name="layout:base" /}
{block name="main_content"}
<div class="row maintop">
  <div class="col-xs-4 col-sm-2">
    <a href="{:url('[admin.auth.rule.create]')}">
      <button class="btn btn-sm btn-primary">
        <i class="ace-icon fa fa-plus bigger-110"></i>添加菜单项
      </button>
    </a>
  </div>
</div>

<div class="row">
  <div class="col-xs-12">
    <form method="post" action="{:url('[admin.auth.rule.resort]')}" >
      <table class="table table-striped table-bordered table-hover" id="dynamic-table">
        <thead>
          <tr>
            <th>菜单标题</th>
            <th>页面名称</th>
            <th>路由名称</th>
            <th class="field-icon center">ICON图标</th>
            <th class="center">状态</th>
            <th class="field-sort center">排序</th>
            <th class="center">操作</th>
          </tr>
        </thead>
        <tbody>
          {volist name="list" id="rule"}
          <tr>
            <td>{$rule['prefix']}{$rule['title']}</td>
            <td>{$rule['name']}</td>
            <td>{$rule['route_name']}</td>
            <td class="field-icon center"><i class="{$rule.icon}"></i></td>
            <td class="field-icon center">{$rule['status_text']}</i></td>
            <td class="field-sort center">
              <input type="text" maxlength="4" name="items[{$rule.id}]" value="{$rule.sort_num}" class="field-style">
            </td>
            <td class="center">
              <a class="green" href="{:url('[admin.auth.rule.edit]', ['id' => $rule.id])}">
                <i class="ace-icon fa fa-pencil bigger-130"></i>编辑
              </a>
              <a id='del-{$rule.id}' class="red" herf="javascript:void(0);" onclick="alert_del(this);" data-del-href="{:url('[admin.auth.rule.delete]', ['id' => $rule.id])}" data-del-id='{$rule.id}'>
                <i class="ace-icon fa fa-trash-o bigger-130"></i>删除
              </a>
            </td>
          </tr>
          {/volist}
        </tbody>
      </table>
      <button class="btn btn-info" type="submit">
        更新排序
      </button>
    </form>
  </div>
</div>
{/block}
